package personal.hn.newjava.service.impl;

import personal.hn.newjava.common.result.TableDataInfo;
import personal.hn.newjava.model.Goods;
import personal.hn.newjava.repository.GoodsRespository;
import personal.hn.newjava.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    GoodsRespository goodsrespository;
    @Override
    public TableDataInfo selectGoodsList(Goods goods, Pageable page) {
        Page<Goods> rs = goodsrespository.findAll(page);
        return TableDataInfo.success(rs.toList(), rs.getTotalElements());
    }
}
